﻿//-----------------------------------------------------------------------
// <copyright file="IProblem.cs" company="Numbrella foundation">
// Copyright (c) Numbrella foundation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Numbrella.Interaction
{
	using System.ServiceModel;

	/// <summary>
	/// Represents problem that can be solved using Numbrella computational network.
	/// </summary>
	[ServiceContract]
	[ServiceKnownType("GetKnownTypes", typeof(KnownTypeManager))]
	public interface IProblem
	{
		/// <summary>
		/// Gets description of this problem.
		/// </summary>
		ProblemDescription Description
		{
			[OperationContract]
			get;
		}

		/// <summary>
		/// Gets implementation aspects of this problem.
		/// </summary>
		ProblemImplementation Implementation
		{
			[OperationContract]
			get;
		}

		/// <summary>
		/// Retrieves task that is pending for execution.
		/// </summary>
		/// <param name="userName">Name of the user who wants to take a task.</param>
		/// <returns>Pending task.</returns>
		[OperationContract]
		ITask GetPendingTask(string userName);

		/// <summary>
		/// Submits result of solved task.
		/// </summary>
		/// <param name="result">Task result.</param>
		/// <param name="userName">Name of the user who wants to submit result.</param>
		[OperationContract]
		void SubmitResult(ITaskResult result, string userName);
	}
}